from redis import StrictRedis
class Config():
    DEBUG=True
    SECRET_KEY='WERDFSsadwasdwqqfsaw'
    # 为数据库添加配置
    SQLALCHEMY_DATABASE_URI='mysql://root:mysql@127.0.0.1:3306/information233'
    SQLALCHEMY_TRACK_MODIFICATIONS=False  #开启当前项目ＣＳＲＦ保护

    REDIS_HOST='127.0.0.1'
    REDIS_PORT=6379
    # session保存在redis数据库中
    SESSION_TYPE='redis'
    # 开启session签名
    SESSION_USE_SINGER=True
    # 制定session保存的redis
    SESSION_REDIS=StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    # 设置需要过期
    SESSION_PERMANENT=False
#     设置过期时间
    PERMANENT_SESSION__LIFETIME=86400 * 2

class DevelopmentConfig(Config):
#     开发环境下的配置
    DEBUG = True

class ProductionConfig(Config):
#     生产环境下的配置
    DEBUG = False

class TestingConfig(Config):
    DEBUG = True
    TESTING=True


config={
    'devlopment':DevelopmentConfig,
    'production':ProductionConfig,
    'testing':TestingConfig
}

